import { Injectable, PipeTransform } from '@nestjs/common'

@Injectable()
export class PagenationPipe implements PipeTransform {
  transform(value: any) {
    if (Reflect.ownKeys(value).length !== 0) {
      if (value['current']) {
        value['current'] = Number(value['current'])
      }
      if (value['size']) {
        value['size'] = Number(value['size'])
      }
    }
    return value
  }
}
